﻿
using Admin.NET.Application.Entity;

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

    /// <summary>
    /// 从机变量基础输入参数
    /// </summary>
    public class DeviceSlaveTemplatePointsBaseInput
    {
        /// <summary>
        /// 变量类型
        /// </summary>
        public virtual int PointType { get; set; }
        
        /// <summary>
        /// 变量名字
        /// </summary>
        public virtual string PointName { get; set; }
        
        /// <summary>
        /// 设备从机模板Id
        /// </summary>
        public virtual long DeviceSlaveTemplateId { get; set; }
        
        /// <summary>
        /// 变量标识符
        /// </summary>
        public virtual string? DataIdentifier { get; set; }
        
        /// <summary>
        /// 千年
        /// </summary>
        public virtual int? Millennials { get; set; }
        
        /// <summary>
        /// 数据类型
        /// </summary>
        public virtual Entity.DataType DataType { get; set; }
        
        /// <summary>
        /// 长度
        /// </summary>
        public virtual string? Len { get; set; }
        
        /// <summary>
        /// 寄存器地址
        /// </summary>
        public virtual string reg { get; set; }
        
        /// <summary>
        /// 寄存器类型
        /// </summary>
        public virtual RegType RegType { get; set; }
        
        /// <summary>
        /// 变量类型
        /// </summary>
        public virtual string? VarType { get; set; }
        
        /// <summary>
        /// 单位
        /// </summary>
        public virtual string? Unit { get; set; }
        
        /// <summary>
        /// 读写属性
        /// </summary>
        public virtual ReadWrite ReadWrite { get; set; }
        
        /// <summary>
        /// 存储位置
        /// </summary>
        public virtual string? Store { get; set; }
        
        /// <summary>
        /// 采集频率
        /// </summary>
        public virtual int Cycle { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        public virtual DateTime? CreateTime { get; set; }
        
        /// <summary>
        /// 更新时间
        /// </summary>
        public virtual DateTime? UpdateTime { get; set; }
        
        /// <summary>
        /// 创建者Id
        /// </summary>
        public virtual long? CreateUserId { get; set; }
        
        /// <summary>
        /// 创建者姓名
        /// </summary>
        public virtual string? CreateUserName { get; set; }
        
        /// <summary>
        /// 修改者Id
        /// </summary>
        public virtual long? UpdateUserId { get; set; }
        
        /// <summary>
        /// 修改者姓名
        /// </summary>
        public virtual string? UpdateUserName { get; set; }
        
        /// <summary>
        /// 软删除
        /// </summary>
        public virtual bool? IsDelete { get; set; }
        
        /// <summary>
        /// 精确几位
        /// </summary>
        public virtual PrecisionEnum PrecisionEnum { get; set; }

    /// <summary>
    /// 采集公式
    /// </summary>

    public string? Formula { get; set; }

    /// <summary>
    /// 控制公式
    /// </summary>

    public string? ReFormula { get; set; }

}

    /// <summary>
    /// 从机变量分页查询输入参数
    /// </summary>
    public class PageDeviceSlaveTemplatePointsInput : BasePageInput
    {
        /// <summary>
        /// 关键字查询
        /// </summary>
        public string? SearchKey { get; set; }

        /// <summary>
        /// 变量名字
        /// </summary>
        public string? PointName { get; set; }
        
        /// <summary>
        /// 设备从机模板Id
        /// </summary>
        public long? DeviceSlaveTemplateId { get; set; }
        
        /// <summary>
        /// 数据类型
        /// </summary>
        public Entity.DataType? DataType { get; set; }
        
        /// <summary>
        /// 长度
        /// </summary>
        public string? Len { get; set; }
        
        /// <summary>
        /// 寄存器类型
        /// </summary>
        public RegType? RegType { get; set; }
        
        /// <summary>
        /// 单位
        /// </summary>
        public string? Unit { get; set; }
        
        /// <summary>
        /// 读写属性
        /// </summary>
        public ReadWrite? ReadWrite { get; set; }
        
        /// <summary>
        /// 精确几位
        /// </summary>
        public PrecisionEnum? PrecisionEnum { get; set; }


}

    /// <summary>
    /// 从机变量增加输入参数
    /// </summary>
    public class AddDeviceSlaveTemplatePointsInput : DeviceSlaveTemplatePointsBaseInput
    {
        /// <summary>
        /// 变量名字
        /// </summary>
        [Required(ErrorMessage = "变量名字不能为空")]
        public override string PointName { get; set; }
        
        /// <summary>
        /// 设备从机模板Id
        /// </summary>
        [Required(ErrorMessage = "设备从机模板Id不能为空")]
        public override long DeviceSlaveTemplateId { get; set; }
        
        /// <summary>
        /// 数据类型
        /// </summary>
        [Required(ErrorMessage = "数据类型不能为空")]
        public override Entity.DataType DataType { get; set; }
        
        /// <summary>
        /// 寄存器地址
        /// </summary>
        [Required(ErrorMessage = "寄存器地址不能为空")]
        public override string reg { get; set; }
        
        /// <summary>
        /// 寄存器类型
        /// </summary>
        [Required(ErrorMessage = "寄存器类型不能为空")]
        public override RegType RegType { get; set; }
        
        /// <summary>
        /// 读写属性
        /// </summary>
        [Required(ErrorMessage = "读写属性不能为空")]
        public override ReadWrite ReadWrite { get; set; }
        
        /// <summary>
        /// 采集频率
        /// </summary>
        [Required(ErrorMessage = "采集频率不能为空")]
        public override int Cycle { get; set; }
        
        /// <summary>
        /// 精确几位
        /// </summary>
        [Required(ErrorMessage = "精确几位不能为空")]
        public override PrecisionEnum PrecisionEnum { get; set; }

    /// <summary>
    /// 采集公式
    /// </summary>

    public string? Formula { get; set; }

    /// <summary>
    /// 控制公式
    /// </summary>

    public string? ReFormula { get; set; }

}

    /// <summary>
    /// 从机变量删除输入参数
    /// </summary>
    public class DeleteDeviceSlaveTemplatePointsInput : BaseIdInput
    {
    }

    /// <summary>
    /// 从机变量更新输入参数
    /// </summary>
    public class UpdateDeviceSlaveTemplatePointsInput : DeviceSlaveTemplatePointsBaseInput
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        [Required(ErrorMessage = "主键Id不能为空")]
        public long Id { get; set; }
        
    }

    /// <summary>
    /// 从机变量主键查询输入参数
    /// </summary>
    public class QueryByIdDeviceSlaveTemplatePointsInput : DeleteDeviceSlaveTemplatePointsInput
    {

    }
